# $LastChangedDate: 2010-05-25 21:26:05 -0400 (Tue, 25 May 2010) $
# LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG
# Build executable.
# Notes:
# - See module.txt.
#-------------------------------------------------------------------------------

# Creates the cmake top-level target.  ADD_EXECUTABLE() requires source file args.
ADD_EXECUTABLE(
    ${PROJECT_TARGET}
    ${MODULE_SRC_CXX}
    ${MODULE_SRC_C}
)

# OSG libs needed for this project.
IF( OSG_FOUND )
SET( PROJECT_OSG_LIBS
     osg
     osgDB
     osgGA
     osgViewer
     osgUtil
     osgFX
     osgParticle
     osgText
     osgManipulator
     osgShadow
)
ENDIF()

TARGET_LINK_LIBRARIES(
    ${PROJECT_TARGET}  # executable
    ${PROJECT_LIBS}
    ${PROJECT_OSG_LIBS}
    ${OPENTHREADS_LIBS}
    ${OPENGL_LIBRARIES}
    ${SYSTEM_LIBS}
)

INSTALL( TARGETS ${PROJECT_TARGET}
         RUNTIME DESTINATION bin )
